package com.daocao.hua.fragment;

import android.os.Bundle;
import android.util.Log;
import android.view.GestureDetector;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.daocao.hua.R;


import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * Created by xsooy-pc on 2017/7/12.
 */

public class LoanForNewFragment extends BaseFragment {


    @BindView(R.id.img_banner)
    ImageView imgBanner;
    @BindView(R.id.txt_title)
    TextView txtTitle;
    @BindView(R.id.txt_content)
    TextView txtContent;
    Unbinder unbinder;
    private String title;
    private String content;
    private int poi;
    private String image;

    public LoanForNewFragment setTitle(int poi, String title, String content, String image) {
        this.title = title;
        this.content = content;
        this.poi = poi;
        this.image = image;
        return this;
    }


    @Override
    protected int setLayoutId() {
        return R.layout.fragment_loan_for_new;
    }

    @Override
    protected void initView() {
        txtTitle.setText(title);
        txtContent.setText(content);
        Glide.with(this).load(image).error(R.mipmap.banner).into(imgBanner);
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // TODO: inflate a fragment view
        View rootView = super.onCreateView(inflater, container, savedInstanceState);
        unbinder = ButterKnife.bind(this, rootView);
        rootView.setTag(poi);
        return rootView;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }
}
